package com.ibm.cps.sql.netsfparser;

import java.util.ArrayList;
import java.util.List;

import com.ibm.util.StringUtil;

import net.sf.jsqlparser.schema.Table;
import net.sf.jsqlparser.statement.select.FromItemVisitor;
import net.sf.jsqlparser.statement.select.LateralSubSelect;
import net.sf.jsqlparser.statement.select.SubJoin;
import net.sf.jsqlparser.statement.select.SubSelect;
import net.sf.jsqlparser.statement.select.ValuesList;

public class FromItemParser implements FromItemVisitor {
	private final List<String> dataSources = new ArrayList<>();
	
	public List<String> getDataSources() {
		return dataSources;
	}

	@Override
	public void visit(Table table) {
		String datasourceName = table.getFullyQualifiedName();
		dataSources.add(StringUtil.removeQuotes(datasourceName));
	}

	@Override
	public void visit(SubSelect arg0) {

	}

	@Override
	public void visit(SubJoin arg0) {

	}

	@Override
	public void visit(LateralSubSelect arg0) {

	}

	@Override
	public void visit(ValuesList arg0) {
	}

}
